package com.gzl.gg.zkutil;

import com.gxl.butt.utils.PropertiesOperator;
import com.gzl.gg.values.StaticValue;

import java.io.IOException;

/**
 * Created by GUOXIAOLIN on 2018/7/14.
 */
public class ZkOperator {

    public static DistributedLock getZkLock(String lockname){
        DistributedLock lock = null;
        try {
            lock = new DistributedLock(PropertiesOperator.getApplication_Properties_Field("zkips"), lockname);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return lock;
    }


    /* SECSKILL 秒 后跳过锁 */
    public static void secskill() {

        System.out.println(--StaticValue.SEC_SKILL);
    }
}
